//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class INelContext {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public INelContext(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(INelContext obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_INelContext(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static INelContext getInstance() {
    return new INelContext(nelmiscJNI.INelContext_getInstance(), false);
  }

  public static boolean isContextInitialised() {
    return nelmiscJNI.INelContext_isContextInitialised();
  }

  public SWIGTYPE_p_void getSingletonPointer(String singletonName) {
    long cPtr = nelmiscJNI.INelContext_getSingletonPointer(swigCPtr, this, singletonName);
    return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
  }

  public void setSingletonPointer(String singletonName, SWIGTYPE_p_void ptr) {
    nelmiscJNI.INelContext_setSingletonPointer(swigCPtr, this, singletonName, SWIGTYPE_p_void.getCPtr(ptr));
  }

  public void releaseSingletonPointer(String singletonName, SWIGTYPE_p_void ptr) {
    nelmiscJNI.INelContext_releaseSingletonPointer(swigCPtr, this, singletonName, SWIGTYPE_p_void.getCPtr(ptr));
  }

  public CLog getErrorLog() {
    long cPtr = nelmiscJNI.INelContext_getErrorLog(swigCPtr, this);
    return (cPtr == 0) ? null : new CLog(cPtr, false);
  }

  public void setErrorLog(CLog errorLog) {
    nelmiscJNI.INelContext_setErrorLog(swigCPtr, this, CLog.getCPtr(errorLog), errorLog);
  }

  public CLog getWarningLog() {
    long cPtr = nelmiscJNI.INelContext_getWarningLog(swigCPtr, this);
    return (cPtr == 0) ? null : new CLog(cPtr, false);
  }

  public void setWarningLog(CLog warningLog) {
    nelmiscJNI.INelContext_setWarningLog(swigCPtr, this, CLog.getCPtr(warningLog), warningLog);
  }

  public CLog getInfoLog() {
    long cPtr = nelmiscJNI.INelContext_getInfoLog(swigCPtr, this);
    return (cPtr == 0) ? null : new CLog(cPtr, false);
  }

  public void setInfoLog(CLog infoLog) {
    nelmiscJNI.INelContext_setInfoLog(swigCPtr, this, CLog.getCPtr(infoLog), infoLog);
  }

  public CLog getDebugLog() {
    long cPtr = nelmiscJNI.INelContext_getDebugLog(swigCPtr, this);
    return (cPtr == 0) ? null : new CLog(cPtr, false);
  }

  public void setDebugLog(CLog debugLog) {
    nelmiscJNI.INelContext_setDebugLog(swigCPtr, this, CLog.getCPtr(debugLog), debugLog);
  }

  public CLog getAssertLog() {
    long cPtr = nelmiscJNI.INelContext_getAssertLog(swigCPtr, this);
    return (cPtr == 0) ? null : new CLog(cPtr, false);
  }

  public void setAssertLog(CLog assertLog) {
    nelmiscJNI.INelContext_setAssertLog(swigCPtr, this, CLog.getCPtr(assertLog), assertLog);
  }

  public CMemDisplayer getDefaultMemDisplayer() {
    long cPtr = nelmiscJNI.INelContext_getDefaultMemDisplayer(swigCPtr, this);
    return (cPtr == 0) ? null : new CMemDisplayer(cPtr, false);
  }

  public void setDefaultMemDisplayer(CMemDisplayer memDisplayer) {
    nelmiscJNI.INelContext_setDefaultMemDisplayer(swigCPtr, this, CMemDisplayer.getCPtr(memDisplayer), memDisplayer);
  }

  public CMsgBoxDisplayer getDefaultMsgBoxDisplayer() {
    long cPtr = nelmiscJNI.INelContext_getDefaultMsgBoxDisplayer(swigCPtr, this);
    return (cPtr == 0) ? null : new CMsgBoxDisplayer(cPtr, false);
  }

  public void setDefaultMsgBoxDisplayer(CMsgBoxDisplayer msgBoxDisplayer) {
    nelmiscJNI.INelContext_setDefaultMsgBoxDisplayer(swigCPtr, this, CMsgBoxDisplayer.getCPtr(msgBoxDisplayer), msgBoxDisplayer);
  }

  public boolean getDebugNeedAssert() {
    return nelmiscJNI.INelContext_getDebugNeedAssert(swigCPtr, this);
  }

  public void setDebugNeedAssert(boolean needAssert) {
    nelmiscJNI.INelContext_setDebugNeedAssert(swigCPtr, this, needAssert);
  }

  public boolean getNoAssert() {
    return nelmiscJNI.INelContext_getNoAssert(swigCPtr, this);
  }

  public void setNoAssert(boolean noAssert) {
    nelmiscJNI.INelContext_setNoAssert(swigCPtr, this, noAssert);
  }

  public boolean getAlreadyCreateSharedAmongThreads() {
    return nelmiscJNI.INelContext_getAlreadyCreateSharedAmongThreads(swigCPtr, this);
  }

  public void setAlreadyCreateSharedAmongThreads(boolean b) {
    nelmiscJNI.INelContext_setAlreadyCreateSharedAmongThreads(swigCPtr, this, b);
  }

}
